package io.renren.modules.app.enums;

import java.util.Objects;

/**
 * 盘库订单状态
 * create by znr48268 on 2018/12/12
 */
public enum CheckOrderStatusEnum {
    初始化(0, "初始化"),
    待盘点(1, "待盘点"),
    盘点中(2, "盘点中"),
    盘点完成(3, "盘点完成"),
    实际多(4, "实际多"),
    实际少(5, "实际少"),
    库存一致(6, "库存一致");
    private Integer value;
    private String text;

    CheckOrderStatusEnum(int i, String s) {
        this.value = i;
        this.text = s;

    }

    public static CheckOrderStatusEnum getEnumByValue(Integer value) {
        for (CheckOrderStatusEnum item : CheckOrderStatusEnum.values()) {
            if (Objects.equals(value, item.getValue())) {
                return item;
            }
        }
        return null;
    }

    public static String getTextByValue(Integer value) {
        if (value != null) {
            for (CheckOrderStatusEnum item : CheckOrderStatusEnum.values()) {
                if (Objects.equals(value, item.getValue())) {
                    return item.getText();
                }
            }
        }
        return "";
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
